cmake_minimum_required(VERSION 3.5.1)
project(example)
# 输出路径、编译路径、编译类型(debug/release)均在clion中进行处理,自己编写请手动指定
find_package(pybind11 CONFIG REQUIRED)
include_directories(${pybind11_INCLUDE_DIRS})

#find_package(Python3 COMPONENTS Interpreter Development REQUIRED)

message( [MAIN] "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
message( [Main] " pybind11_INCLUDE_DIRS = ${pybind11_INCLUDE_DIRS}")
message( [Main] " pybind11_LIBRARIES = ${pybind11_LIBRARIES}")

# add_library(example SHARED main.cpp) #使用该方式生成模块请将so文件改为模块名eg:libexample.so -> example.so

add_executable(example example.cpp)
# 该方式直接生成so模块直接用
#pybind11_add_module(example example.cpp)

target_link_libraries(example PRIVATE pybind11::embed)